package com.heima.domain;

import java.util.ArrayList;

public class GetIndex {
    public int getIndex(ArrayList<Student> list,String id){
        int index = -1;
        for (int i = 0; i < list.size(); i++) {
            Student stu =list.get(i);
            if(id.equals(stu.getId())){
                index = i;
            }
        }
        return index;
    }
}
